<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="generator" content="ApiGen; http://apigen.org" />

	<title>Class Nette\Object</title>

	<link rel="stylesheet" href="resources/style.css?v=2011071314" type="text/css" media="all" />
	<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
	<link rel="search" href="opensearch.xml" type="application/opensearchdescription+xml" title="Nette Framework API documentation" />
	<script type="text/javascript" src="resources/combined.js"></script>
	<script type="text/javascript" src="allclasses.js"></script>
</head>

<body>
<div id="left">
	<a href="allclasses.html">All Classes</a>

	<h3>Namespaces</h3>
	<ul>
		<li><a href="namespace-none.html">none</a>
		</li>
		<li class="active"><a href="namespace-Nette.html">Nette</a>
		</li>
		<li><a href="namespace-Nette.Application.html">Nette\Application</a>
		</li>
		<li><a href="namespace-Nette.Caching.html">Nette\Caching</a>
		</li>
		<li><a href="namespace-Nette.Collections.html">Nette\Collections</a>
		</li>
		<li><a href="namespace-Nette.Config.html">Nette\Config</a>
		</li>
		<li><a href="namespace-Nette.Forms.html">Nette\Forms</a>
		</li>
		<li><a href="namespace-Nette.IO.html">Nette\IO</a>
		</li>
		<li><a href="namespace-Nette.Loaders.html">Nette\Loaders</a>
		</li>
		<li><a href="namespace-Nette.Mail.html">Nette\Mail</a>
		</li>
		<li><a href="namespace-Nette.Reflection.html">Nette\Reflection</a>
		</li>
		<li><a href="namespace-Nette.Security.html">Nette\Security</a>
		</li>
		<li><a href="namespace-Nette.Templates.html">Nette\Templates</a>
		</li>
		<li><a href="namespace-Nette.Web.html">Nette\Web</a>
		</li>
		<li><a href="namespace-PHP.html">PHP</a>
		</li>
	</ul>

	<hr />

	<h3>Classes</h3>

	<ul>
		<li><a href="Nette.ArrayTools.html">ArrayTools</a></li>
		<li><a href="Nette.Callback.html">Callback</a></li>
		<li><a href="Nette.Component.html">Component</a></li>
		<li><a href="Nette.ComponentContainer.html">ComponentContainer</a></li>
		<li><a href="Nette.Configurator.html">Configurator</a></li>
		<li><a href="Nette.DateTime.html">DateTime</a></li>
		<li><a href="Nette.Debug.html">Debug</a></li>
		<li><a href="Nette.Environment.html">Environment</a></li>
		<li><a href="Nette.Framework.html">Framework</a></li>
		<li><a href="Nette.FreezableObject.html">FreezableObject</a></li>
		<li><a href="Nette.GenericRecursiveIterator.html">GenericRecursiveIterator</a></li>
		<li><a href="Nette.Image.html">Image</a></li>
		<li><a href="Nette.ImageMagick.html">ImageMagick</a></li>
		<li><a href="Nette.InstanceFilterIterator.html">InstanceFilterIterator</a></li>
		<li class="active"><a href="Nette.Object.html">Object</a></li>
		<li><a href="Nette.ObjectMixin.html">ObjectMixin</a></li>
		<li><a href="Nette.Paginator.html">Paginator</a></li>
		<li><a href="Nette.RecursiveComponentIterator.html">RecursiveComponentIterator</a></li>
		<li><a href="Nette.ServiceLocator.html">ServiceLocator</a></li>
		<li><a href="Nette.SmartCachingIterator.html">SmartCachingIterator</a></li>
		<li><a href="Nette.String.html">String</a></li>
		<li><a href="Nette.Tools.html">Tools</a></li>
	</ul>

	<h3>Interfaces</h3>

	<ul>
		<li><a href="Nette.IComponent.html">IComponent</a></li>
		<li><a href="Nette.IComponentContainer.html">IComponentContainer</a></li>
		<li><a href="Nette.IDebuggable.html">IDebuggable</a></li>
		<li><a href="Nette.IServiceLocator.html">IServiceLocator</a></li>
		<li><a href="Nette.ITranslator.html">ITranslator</a></li>
	</ul>

	<h3>Exceptions</h3>

	<ul>
		<li><a href="Nette.AmbiguousServiceException.html">AmbiguousServiceException</a></li>
	</ul>
</div>

<div id="right">
	<form action="http://www.google.com/cse" id="search" onsubmit="if(this.q.value.indexOf('more:')==-1)this.q.value+=' more:api'">
		<input type="hidden" name="cx" value="011549293477758430224:vxofa9ufnhc" /><input type="hidden" name="ie" value="UTF-8" /><input type="text" name="q" class="text" /><input type="submit" value="Search" />
	</form>

<div id="navigation">
	<ul>
		<li><a href="overview.html" title="Summary of all namespaces">Overview</a></li>
		<li><a href="namespace-Nette.html" title="Summary of Nette">Namespace</a></li>
		<li class="active">Class</li>
		<li><a href="elements.html">Elements</a></li>
	</ul>
</div>

<div id="content">
	<div id="classSummary">
		<p>namespace <a href="namespace-Nette.html">Nette</a></p>

		<h1>Class Object</h1>

		<div class="classDescription">
		
<p>Nette\Object is the ultimate ancestor of all instantiable classes.</p>

<p>It defines some handful methods and enhances object core of PHP:<br>
 – access to undeclared members throws exceptions<br>
 – support for conventional properties with getters and setters<br>
 – support for event raising functionality<br>
 – ability to add new methods to class (extension methods)</p>

<p>Properties is a syntactic sugar which allows access public getter and
setter<br>
methods as normal object variables. A property is defined by a getter
method<br>
and optional setter method (no setter method means read-only property).</p>

<pre>
<span class="php-var">$val</span> = <span
class="php-var">$obj</span>-&gt;label;     <span
class="php-comment">// equivalent to $val = $obj-&gt;getLabel();
</span><span
class="php-var">$obj</span>-&gt;label = <span
class="php-quote">'Nette'</span>;  <span
class="php-comment">// equivalent to $obj-&gt;setLabel('Nette');
</span></pre>

<p>Property names are case-sensitive, and they are written in the camelCaps<br>
or PascalCaps.</p>

<p>Event functionality is provided by declaration of property named
‚on{Something}‘<br>
Multiple handlers are allowed.</p>

<pre>
<span class="php-keyword1">public</span> <span
class="php-var">$onClick</span>;                <span
class="php-comment">// declaration in class
</span><span
class="php-var">$this</span>-&gt;onClick[] = <span
class="php-quote">'callback'</span>;  <span
class="php-comment">// attaching event handler
</span><span
class="php-keyword1">if</span> (!<span class="php-keyword1">empty</span>(<span
class="php-var">$this</span>-&gt;onClick)) ... <span
class="php-comment">// are there any handlers?
</span><span
class="php-var">$this</span>-&gt;onClick(<span
class="php-var">$sender</span>, <span class="php-var">$arg</span>);  <span
class="php-comment">// raises the event with arguments
</span></pre>

<p>Adding method to class (i.e. to all instances) works similar to
JavaScript<br>
prototype property. The syntax for adding a new method is:</p>

<pre>
MyClass::extensionMethod(<span class="php-quote">'newMethod'</span>, <span
class="php-keyword1">function</span>(MyClass <span
class="php-var">$obj</span>, <span
class="php-var">$arg</span>, ...) { ... });
<span
class="php-var">$obj</span> = <span
class="php-keyword1">new</span> MyClass;
<span
class="php-var">$obj</span>-&gt;newMethod(<span
class="php-var">$x</span>);
</pre>

		</div>


		<div>
			<h4>Direct Known Subclasses</h4>
			<a href="Nette.Application.Application.html">Nette\Application\Application</a>, <a href="Nette.Application.CliRouter.html">Nette\Application\CliRouter</a>, <a href="Nette.Application.DownloadResponse.html">Nette\Application\DownloadResponse</a>, <a href="Nette.Application.ForwardingResponse.html">Nette\Application\ForwardingResponse</a>, <a href="Nette.Application.JsonResponse.html">Nette\Application\JsonResponse</a>, <a href="Nette.Application.Link.html">Nette\Application\Link</a>, <a href="Nette.Application.RedirectingResponse.html">Nette\Application\RedirectingResponse</a>, <a href="Nette.Application.RenderResponse.html">Nette\Application\RenderResponse</a>, <a href="Nette.Application.Route.html">Nette\Application\Route</a>, <a href="Nette.Application.SimpleRouter.html">Nette\Application\SimpleRouter</a>, <a href="Nette.Caching.Cache.html">Nette\Caching\Cache</a>, <a href="Nette.Caching.DummyStorage.html">Nette\Caching\DummyStorage</a>, <a href="Nette.Caching.FileStorage.html">Nette\Caching\FileStorage</a>, <a href="Nette.Caching.MemcachedStorage.html">Nette\Caching\MemcachedStorage</a>, <a href="Nette.Callback.html">Callback</a>, <a href="Nette.Component.html">Component</a>, <a href="Nette.Configurator.html">Configurator</a>, <a href="Nette.Forms.ConventionalRenderer.html">Nette\Forms\ConventionalRenderer</a>, <a href="Nette.Forms.FormGroup.html">Nette\Forms\FormGroup</a>, <a href="Nette.Forms.InstantClientScript.html">Nette\Forms\InstantClientScript</a>, <a href="Nette.Forms.Rule.html">Nette\Forms\Rule</a>, <a href="Nette.Forms.Rules.html">Nette\Forms\Rules</a>, <a href="Nette.FreezableObject.html">FreezableObject</a>, <a href="Nette.Image.html">Image</a>, <a href="Nette.Loaders.AutoLoader.html">Nette\Loaders\AutoLoader</a>, <a href="Nette.Mail.MailMimePart.html">Nette\Mail\MailMimePart</a>, <a href="Nette.Mail.SendmailMailer.html">Nette\Mail\SendmailMailer</a>, <a href="Nette.Paginator.html">Paginator</a>, <a href="Nette.Reflection.Annotation.html">Nette\Reflection\Annotation</a>, <a href="Nette.Security.Permission.html">Nette\Security\Permission</a>, <a href="Nette.Security.SimpleAuthenticator.html">Nette\Security\SimpleAuthenticator</a>, <a href="Nette.ServiceLocator.html">ServiceLocator</a>, <a href="Nette.Templates.BaseTemplate.html">Nette\Templates\BaseTemplate</a>, <a href="Nette.Templates.CachingHelper.html">Nette\Templates\CachingHelper</a>, <a href="Nette.Templates.LatteFilter.html">Nette\Templates\LatteFilter</a>, <a href="Nette.Templates.LatteMacros.html">Nette\Templates\LatteMacros</a>, <a href="Nette.Templates.SnippetHelper.html">Nette\Templates\SnippetHelper</a>, <a href="Nette.Web.Ftp.html">Nette\Web\Ftp</a>, <a href="Nette.Web.Html.html">Nette\Web\Html</a>, <a href="Nette.Web.HttpContext.html">Nette\Web\HttpContext</a>, <a href="Nette.Web.HttpRequest.html">Nette\Web\HttpRequest</a>, <a href="Nette.Web.HttpResponse.html">Nette\Web\HttpResponse</a>, <a href="Nette.Web.HttpUploadedFile.html">Nette\Web\HttpUploadedFile</a>, <a href="Nette.Web.Session.html">Nette\Web\Session</a>, <a href="Nette.Web.SessionNamespace.html">Nette\Web\SessionNamespace</a>, <a href="Nette.Web.User.html">Nette\Web\User</a>
		</div>


		<div class="classInfo">
			<b>Abstract Class</b><br />
				<b>Author:</b> David Grudl<br />
			<b>Located at</b> <a href="source-Utils.Object.php.html#18">/Utils/Object.php</a><br />
		</div>
	</div>


	<div id="methodSummary">
		<table class="summary">
		<caption>Method Summary</caption>
		<tr data-order="1 getClass" id="_getClass" class="deprecated">
			<td align="right" width="1%"><code class="nowrap">
				deprecated  public 
				
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_getClass">#</a>
			<code class="nowrap">
				<a href="source-Utils.Object.php.html#62" title="go to source code"><b>getClass</b></a>(
			)</code>

			<div class="short">
				
			</div>

			<div class="detailed">
				





			</div>
			</td>
		</tr>
		<tr data-order="0 getReflection" id="_getReflection">
			<td align="right" width="1%"><code class="nowrap">
				 public static
				<a href="Nette.Reflection.ClassReflection.html">Nette\Reflection\ClassReflection</a>
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_getReflection">#</a>
			<code class="nowrap">
				<a href="source-Utils.Object.php.html#73" title="go to source code"><b>getReflection</b></a>(
			)</code>

			<div class="short">
				
<p>Access to reflection.</p>

			</div>

			<div class="detailed">
				
<p>Access to reflection.</p>




					<h4>Returns</h4>
					<div class="smallList"><a href="Nette.Reflection.ClassReflection.html">Nette\Reflection\ClassReflection</a> </div>


			</div>
			</td>
		</tr>
		<tr data-order="1 __call" id="___call">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				mixed
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#___call">#</a>
			<code class="nowrap">
				<a href="source-Utils.Object.php.html#84" title="go to source code"><b>__call</b></a>(
					string
					<var>$name</var>, 
					array
					<var>$args</var>
			)</code>

			<div class="short">
				
<p>Call to undefined method.</p>

			</div>

			<div class="detailed">
				
<p>Call to undefined method.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$name</code> string method name<br />
						<code>$args</code> array arguments<br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">mixed </div>

					<h4>Throws</h4>
					<div class="smallList">
						<a href="MemberAccessException.html">MemberAccessException</a> <br />
					</div>

			</div>
			</td>
		</tr>
		<tr data-order="0 __callStatic" id="___callStatic">
			<td align="right" width="1%"><code class="nowrap">
				 public static
				mixed
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#___callStatic">#</a>
			<code class="nowrap">
				<a href="source-Utils.Object.php.html#98" title="go to source code"><b>__callStatic</b></a>(
					string
					<var>$name</var>, 
					array
					<var>$args</var>
			)</code>

			<div class="short">
				
<p>Call to undefined static method.</p>

			</div>

			<div class="detailed">
				
<p>Call to undefined static method.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$name</code> string method name (in lower case!)<br />
						<code>$args</code> array arguments<br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">mixed </div>

					<h4>Throws</h4>
					<div class="smallList">
						<a href="MemberAccessException.html">MemberAccessException</a> <br />
					</div>

			</div>
			</td>
		</tr>
		<tr data-order="0 extensionMethod" id="_extensionMethod">
			<td align="right" width="1%"><code class="nowrap">
				 public static
				mixed
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#_extensionMethod">#</a>
			<code class="nowrap">
				<a href="source-Utils.Object.php.html#113" title="go to source code"><b>extensionMethod</b></a>(
					string
					<var>$name</var>, 
					mixed
					<var>$callback</var> = <span class="php-keyword1">NULL</span>
			)</code>

			<div class="short">
				
<p>Adding method to class.</p>

			</div>

			<div class="detailed">
				
<p>Adding method to class.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$name</code> string method name<br />
						<code>$callback</code> mixed callback or closure<br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">mixed </div>


			</div>
			</td>
		</tr>
		<tr data-order="1 __get" id="___get">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				mixed
				&amp;
				</code>
			</td>

			<td>
			<a class="anchor" href="#___get">#</a>
			<code class="nowrap">
				<a href="source-Utils.Object.php.html#136" title="go to source code"><b>__get</b></a>(
					string
					<var>$name</var>
			)</code>

			<div class="short">
				
<p>Returns property value. Do not call directly.</p>

			</div>

			<div class="detailed">
				
<p>Returns property value. Do not call directly.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$name</code> string property name<br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">mixed property value</div>

					<h4>Throws</h4>
					<div class="smallList">
						<a href="MemberAccessException.html">MemberAccessException</a> if the property is not defined.<br />
					</div>

			</div>
			</td>
		</tr>
		<tr data-order="1 __set" id="___set">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				void
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#___set">#</a>
			<code class="nowrap">
				<a href="source-Utils.Object.php.html#149" title="go to source code"><b>__set</b></a>(
					string
					<var>$name</var>, 
					mixed
					<var>$value</var>
			)</code>

			<div class="short">
				
<p>Sets value of a property. Do not call directly.</p>

			</div>

			<div class="detailed">
				
<p>Sets value of a property. Do not call directly.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$name</code> string property name<br />
						<code>$value</code> mixed property value<br />
					</div>


					<h4>Throws</h4>
					<div class="smallList">
						<a href="MemberAccessException.html">MemberAccessException</a> if the property is not defined or is read-only<br />
					</div>

			</div>
			</td>
		</tr>
		<tr data-order="1 __isset" id="___isset">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				bool
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#___isset">#</a>
			<code class="nowrap">
				<a href="source-Utils.Object.php.html#163" title="go to source code"><b>__isset</b></a>(
					string
					<var>$name</var>
			)</code>

			<div class="short">
				
<p>Is property defined?</p>

			</div>

			<div class="detailed">
				
<p>Is property defined?</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$name</code> string property name<br />
					</div>

					<h4>Returns</h4>
					<div class="smallList">bool </div>


			</div>
			</td>
		</tr>
		<tr data-order="1 __unset" id="___unset">
			<td align="right" width="1%"><code class="nowrap">
				 public 
				void
				
				</code>
			</td>

			<td>
			<a class="anchor" href="#___unset">#</a>
			<code class="nowrap">
				<a href="source-Utils.Object.php.html#175" title="go to source code"><b>__unset</b></a>(
					string
					<var>$name</var>
			)</code>

			<div class="short">
				
<p>Access to undeclared property.</p>

			</div>

			<div class="detailed">
				
<p>Access to undeclared property.</p>



					<h4>Parameters</h4>
					<div class="smallList">
						<code>$name</code> string property name<br />
					</div>


					<h4>Throws</h4>
					<div class="smallList">
						<a href="MemberAccessException.html">MemberAccessException</a> <br />
					</div>

			</div>
			</td>
		</tr>

		</table>
	</div>









</div>

	<div id="footer">
		Nette Framework API documentation generated by <a href="http://apigen.org">ApiGen</a>
	</div>
</div>
</body>
</html>
